home *** CD-ROM | disk | FTP | other *** search
- /*{{{}}}*/
- /*{{{ #includes*/
- #ifdef CONFIG_H
- # include "config.h"
- #endif
-
- #include <sys/types.h>
- #include <ctype.h>
- #include <limits.h>
- #include <stdlib.h>
- #include <stdio.h>
-
- #define SET_C
- #define I_INIT_C
- #define I_GETMSG_C
- #define I_MESSAGES_C
- #define I_SCREEN_C
- #define I_SIGNALS_C
-
- #include "origami.h"
-
- #include <h/rcformat.h>
- #include <lib/ori_rc_lib.h>
- #include <lib/ori_add_lib.h>
- /*}}} */
-
- /*{{{ variables*/
- private SetField *setlist=0;
- private int set_used=0;
- /*}}} */
-
- /*{{{ init_set*/
- public boolean init_set(void)
- { int no;
- int lg;
-
- no=rc_get_w(rcfile);
- set_used=no;
- /*{{{ get bitmaps*/
- if (no<=0 || !(setlist=paket_malloc(no*SET_LG)))
- { eputs((unsigned char *)M_NO_MEMORY);
- eputc('\n');
- return(True);
- }
- while (no--)
- rc_nget_c(rcfile,SET_LG,setlist[no]);
- /*}}} */
- /*{{{ get names*/
- lg=rc_get_w(rcfile);
- rc_skip_cw(rcfile,lg,0);
- /*}}} */
-
- return(False);
- }
- /*}}} */
- /*{{{ test_char_set*/
- public boolean test_char_set(int x,SetId setno)
- {
- switch (setno)
- { case alnum_set: return((boolean)isalnum(x));
- case digit_set: return((boolean)isdigit(x));
- case alpha_set: return((boolean)isalpha(x));
- case upper_set: return((boolean)isupper(x));
- case lower_set: return((boolean)islower(x));
- case blank_set: return(x==' ' || x=='\t');
- case xdigi_set: return((boolean)isxdigit(x));
- case cntrl_set: return((boolean)iscntrl(x));
- case punct_set: return((boolean)ispunct(x));
- case print_set: return((boolean)isprint(x));
- case space_set: return((boolean)isspace(x));
- case graph_set: return((boolean)isgraph(x));
- default:
- if (setno>=0 && setno<set_used)
- return((boolean)((1<<(x&7))&setlist[setno][x>>3]));
- else
- exit_origami(r_ocl_err,get_msg(F_INT_OCL,"set",setno));
-
- }
- }
- /*}}} */
- /*{{{ set_copy*/
- public void set_copy(int to,int from)
- {
- int i;
-
- for (i=0;i<SET_LG;i++)
- setlist[to][i]=setlist[from][i];
- }
- /*}}} */
-